<template>
  <div>403 {{ time }}后跳转</div>
</template>

<script>
export default {
  name: "403",
  data() {
    return {
      time: 5,
      interval: undefined
    };
  },
  mounted() {
    this.interval = setInterval(() => {
      this.time -= 1;
      if (this.time === 0) {
        this.$router.push({
          name: "Home"
        });
      }
    }, 1000);
  },
  beforeDestroy() {
    this.time = 5;
    clearInterval(this.interval);
  }
};
</script>

<style scoped></style>
